#!/usr/bin/python2


def count(stream):
    nchar = 0;
    nword = 0;
    nline = 0;
    while True:
        line = stream.readline()
        if line == '':
            break

        if line[-1] == '\n':
            nline += 1

        nchar += len(line)

        # counting words is a little bit complicated
        # consider the following situations
        # ^123 4  567  89   $
        # ^    1 2 3 $
        # ^     $
        for x in line.strip().split():
            if x != '':
                nword += 1

    return nline, nword, nchar

if __name__ == "__main__":
    import sys
    nline, nword, nchar = count(sys.stdin)
    print nline, nword, nchar
